package com.happy.admin.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * \* User: wei.zhang
 * \* Date: 2020/3/18 18:50
 * \* Description:
 *
 * @author wei.zhang
 * \
 */
@Configuration
public class ThreadPoolConfiguration {

    @Bean
    public ThreadPoolExecutor  threadPoolExecutor(){
       return  new ThreadPoolExecutor(2,5,1, TimeUnit.MINUTES,new ArrayBlockingQueue<>(500));

    }

}
